/*
 * RenderObjectContainer.h
 *
 *  Created on: 2008/12/25
 *      Author: Yongshik Cho
 */

#ifndef RENDEROBJECTCONTAINER_H_
#define RENDEROBJECTCONTAINER_H_

#include <vector>

#ifndef RENDEROBJECT_H_
#	include "RenderObject.h"
#endif

#ifndef EVENT_H_
#	include "event/Event.h"
#endif

#include "sqplus/sqplus.h"
using namespace SqPlus;


class RenderObjectContainer : public RenderObject
{
public:
//	RenderObjectContainer(RenderObject* parent = 0, Vector2D size = Vector2D(0.f, 0.f));
	RenderObjectContainer(Vector2D size = Vector2D(0.f, 0.f));
	virtual ~RenderObjectContainer();

public:
	virtual void addChild(RenderObject* ro);
	virtual void subChild(RenderObject* ro);
	virtual	const uint32 getChildCount() const { return (uint32)mChildren.size(); }
	virtual RenderObject* getChild(uint32 index);
	virtual RenderObject* getChildByName(const String& name);
	virtual void setVisible(const bool visible);
	virtual void setLocked(const bool locked);
	virtual void setAlpha(uint8 alpha);
	virtual void pushRenderables(vector<Renderable*>& vp, vector<Renderable*>& nosort);

	virtual void buildQuadtree();
	virtual void clearQuadtree();

	/*
	virtual void preRender();
	virtual void render();
	virtual void postRender();
	*/
	virtual void onMouseEvent(const Event& e);

protected:
	vector<RenderObject*> 	mChildren;
};

//must be declared here
DECLARE_INSTANCE_TYPE(RenderObjectContainer)

#endif /* RENDEROBJECTCONTAINER_H_ */
